/**
 * 角色接口
 */
export interface Role {
  id: number
  name: string
  code: string
  description?: string
  isActive: boolean
  createdAt: string
  updatedAt: string
}

/**
 * 用户接口
 */
export interface User {
  id: number
  username: string
  email: string
  nickname: string
  avatar?: string
  roles?: Role[]
  status: 'active' | 'inactive'
  createdAt: string
  updatedAt: string
}

/**
 * 登录请求接口
 */
export interface LoginRequest {
  username: string
  password: string
}

/**
 * 登录响应接口
 */
export interface LoginResponse {
  access_token: string
  token_type: string
  expires_in: number
  user: User
  permissions?: string[]
}

/**
 * 权限接口
 */
export interface Permission {
  id: number
  name: string
  code: string
  type: 'menu' | 'action'
  description?: string
  resource: string
  action: string
  isActive: boolean
  children?: Permission[]
  createdAt: string
  updatedAt: string
}

/**
 * API响应基础接口
 */
export interface ApiResponse<T = any> {
  code: number
  message: string
  data: T
  timestamp: string
}

/**
 * 分页响应接口
 */
export interface PaginatedResponse<T = any> {
  items: T[]
  total: number
  page: number
  limit: number
  totalPages: number
}